package org.example.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BookMarksTagsMapper {
    @Insert("insert into bookmarks_tags(bookmark_id, tag_id) values(#{bookmarkId}, #{tagId})")
    void addBookMarkTags(Integer bookmarkId, Integer tagId);

//    查询某一书签下的所有标签
    @Select("select tag_id from bookmarks_tags where bookmark_id=#{bookmarkId}")
    List<Integer> tagIdList(Integer bookmarkId);
    // 根据标签id删除
    void deleteByTagIds(Integer bookmarkId, List<Integer> tagIds);
    // 根据书签id删除
    void deleteByBookMarkId(List<Integer> bookmarkIds);
}

